import { Injectable } from '@angular/core';
import { HttpClient } from '../../../../providers/httpClient';
import { Config } from '../../../../providers/config';
import { Storage } from '@ionic/storage';
import { Common } from '../../../../providers/common';

@Injectable()
export class IrpPoolListService {
    constructor(
        public httpClient: HttpClient,
        public config: Config,
        public storage: Storage,
        public common: Common
    ) { }

    getOrgid(loginid) {
        let postBody: any = {
            module: "KSB",
            method: "IRM_A02_0010",
            params: {
                logonname: loginid,
            }
        };

        return this.httpClient.post(postBody, {
            isShowLoading: true
        });
    }

    getStockAdjustData(orgid, startdate, enddate) {
        let postBody: any = {
            module: "KSB",
            method: "IRM_A02_0110",
            format: "json",
            params: {
                "orgid": orgid,
                "startdate": startdate,
                "enddate": enddate
            }
        };

        return this.httpClient.post(postBody, {
            isShowLoading: true
        });
    }

    getStockPoolDatas(startdate, enddate) {
        let postBody: any = {
            module: "OAServer",
            method: "getStockPoolDatas",
            params: {
                "startdate": startdate,
                "enddate": enddate   
            }
        };

        return this.httpClient.post(postBody, {
            isShowLoading: true
        });
    }
}
